package com.jshare.dao;

import java.util.List;

import com.jshare.entity.Article;

public interface ArticleDAO {

	//property constants
	public static final String TITLE = "title";
	public static final String CONTENT = "content";
	public static final String TAGS = "tags";
	
	/**
     * 分页查询
     * @param hql 查询的条件
     * @param offset 开始记录
     * @param length 一次查询几条记录
     * @return
     */
    public List queryForPage(final String hql,final int offset,final int length);
    
    /**
     * 查询所有记录数
     * @param hql 查询的条件
     * @return 总记录数
     */
    public int getAllRowCount(String hql);
	
    
    
	public abstract void save(Article transientInstance);

	public abstract void delete(Article persistentInstance);
	/**
	 * 根据文章id查出相关文章
	 */
	public abstract Article findById(java.lang.Integer id);

	public abstract List findByExample(Article instance);

	public abstract List findByProperty(String propertyName, Object value);

	public abstract List findByTitle(Object title);

	public abstract List findByContent(Object content);

	public abstract List findByTags(Object tags);

	public abstract List findAll();

	public abstract Article merge(Article detachedInstance);

	public abstract void attachDirty(Article instance);

	public abstract void attachClean(Article instance);

}